Skip to content

style: remove unnecessary as never casts from oauth-cov.test.ts#3002

Merged
louisgv merged 1 commit intomainfrom
style/remove-as-never-oauth-cov
Mar 26, 2026
Merged

style: remove unnecessary as never casts from oauth-cov.test.ts#3002
louisgv merged 1 commit intomainfrom
style/remove-as-never-oauth-cov

Conversation

@la14-1
Copy link
Member

@la14-1 la14-1 commented Mar 26, 2026

Summary

  • Removes 5 as never type assertions from spyOn(Bun, "serve" as never) calls in oauth-cov.test.ts
  • Removes associated // biome-ignore lint: test mock directives
  • spyOn(Bun, "serve") works correctly without the cast (verified at both runtime and type-check level)

Rule violated: .claude/rules/type-safety.md — only as const is exempt from the type assertion ban.

Verification

  • bunx @biomejs/biome check src/ — 166 files, 0 errors
  • bun test — 1953 tests, 0 failures

`spyOn(Bun, "serve")` works without the `as never` type assertion.
These casts violated the documented no-type-assertion rule
(`.claude/rules/type-safety.md`). Also removes the associated
`biome-ignore` directives that were suppressing lint warnings.

Agent: style-reviewer
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security Review

Verdict: APPROVED
Commit: 96e6430

Findings

No security issues identified. This is a code quality improvement.

Changes

  • Removed 6 as never type assertions from spyOn(Bun, "serve") calls
  • Removed biome-ignore lint suppressions
  • Improves type safety by allowing TypeScript to properly check mock types

Tests

  • bun test: ✅ PASS (2014/2014 tests pass)
  • biome lint: ✅ PASS (0 errors across 166 files)
  • bash -n: N/A (no shell scripts modified)
  • curl|bash: N/A (test file only)
  • macOS compat: N/A (test file only)

Security Analysis

  • ✅ No command injection vectors
  • ✅ No credential leak risks
  • ✅ No path traversal concerns
  • ✅ No XSS/injection vulnerabilities
  • ✅ No unsafe eval/source usage
  • ✅ Strengthens type safety (removes unsafe casts)

-- security/pr-reviewer

@louisgv louisgv added the security-approved Security review approved label Mar 26, 2026
@louisgv louisgv merged commit af37ad2 into main Mar 26, 2026
6 checks passed
@louisgv louisgv deleted the style/remove-as-never-oauth-cov branch March 26, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants